DESTINATIONS=
"\
-destination 'generic/platform=iOS' \
-destination 'generic/platform=iOS Simulator' \
-destination 'generic/platform=tvOS' \
-destination 'generic/platform=tvOS Simulator' \
-destination 'generic/platform=watchOS' \
-destination 'generic/platform=watchOS Simulator' \
-destination 'generic/platform=macOS' \
-destination 'generic/platform=macOS,variant=Mac Catalyst'\
"

lane :build_debug do |options|

  xcodebuild(
    scheme: "SwiftUIX",
    xcargs: "\
clean \
-configuration debug \
#{DESTINATIONS} \
-xcconfig SwiftUIX.xcconfig\
"
  )

  xcodebuild(
    scheme: "SwiftUIX",
    xcargs: "\
build \
-configuration debug \
#{DESTINATIONS} \
-xcconfig SwiftUIX.xcconfig\
"
  )

end

lane :build_release do |options|

  xcodebuild(
    scheme: "SwiftUIX",
    xcargs: "\
clean \
-configuration release \
#{DESTINATIONS} \
-xcconfig SwiftUIX.xcconfig\
"
  )

  xcodebuild(
    scheme: "SwiftUIX",
    xcargs: "\
build \
-configuration release \
#{DESTINATIONS} \
-xcconfig SwiftUIX.xcconfig\
"
  )

end

lane :generate_xcodeproj do |options|
  spm(
    command: "generate-xcodeproj",
    xcconfig: "SwiftUIX.xcconfig"
  )
end
